

function sumbmit(){
    var name = $("#name").val();
    var color = $("#color").val();
    var price = $("#price").val();
    var description = $("#description").val();
    var inventory = $("#inventory").val();
    var picture = $("#picture").val();
    var category = $("#category").val();

    $.ajax({
        url:"../goods.do",
        data:{"method":"addGoods",
            "name":name,
            "color":color,
            "price":price,
            "description":description,
            "inventory":inventory,
            "picture":picture,
            "category":category
        },
        // data:{
        //     "method":addGoods,
        //     "form":JSON.stringify(serializeObject($("#goods")))
        // },
        type:"post",
        success:function (result) {
            if(result=='true'){
                alert("添加成功！");
            }else{
                alert("添加失败！");
            }
        }
    })
}

function phonesubmit(){
    var name = $("#name").val();
    var color = $("#color").val();
    var price = $("#price").val();
    var description = $("#description").val();
    var inventory = $("#inventory").val();
    var picture = $("#picture").val();
    var category = $("#category").val();

    var phonescreensize = $("#phonescreensize").val();
    var pixel = $("#pixel").val();
    var phonememory = $("#phonememory").val();
    var batterylife = $("#batterylife").val();
    var cpumodel = $("#cpumodel").val();
    var cpufrequency = $("#cpufrequency").val();
    var frontcamera = $("#frontcamera").val();
    var phonescreenresolution = $("#phonescreenresolution").val();
    var capacity = $("#capacity").val();
    var phonethickness = $("#phonethickness").val();
    var networktype = $("#networktype").val();
    var networkmodel = $("#networkmodel").val();

    $.ajax({
        url:"../goods.do",
        data:{
            "method":"addPhone",
            "phonescreensize":phonescreensize,
            "pixel":pixel,
            "phonememory":phonememory,
            "batterylife":batterylife,
            "cpumodel":cpumodel,
            "cpufrequency":cpufrequency,
            "frontcamera":frontcamera,
            "phonescreenresolution":phonescreenresolution,
            "capacity":capacity,
            "phonethickness":phonethickness,
            "networktype":networktype,
            "networkmodel":networkmodel,

            "name":name,
            "color":color,
            "price":price,
            "description":description,
            "inventory":inventory,
            "picture":picture,
            "category":category
        },
        type: "post",
        success:function (result) {
            if(result=='true'){
                alert("添加成功！");
            }else{
                alert("添加失败！");
            }
        }
    });
}

function tvsubmit() {
    var name = $("#name").val();
    var color = $("#color").val();
    var price = $("#price").val();
    var description = $("#description").val();
    var inventory = $("#inventory").val();
    var picture = $("#picture").val();
    var category = $("#category").val();

    var tvscreensize = $("#tvscreensize").val();
    var tvseries = $("#tvseries").val();
    var remote = $("#remote").val();
    var border = $("#border").val();
    var tvscreenresolution = $("#tvscreenresolution").val();
    var usb = $("#usb").val();

    $.ajax({
        url:"../goods.do",
        data:{
            "method":"addTv",
            "tvscreensize":tvscreensize,
            "tvseries":tvseries,
            "remote":remote,
            "border":border,
            "tvscreenresolution":tvscreenresolution,
            "usb":usb,

            "name":name,"color":color,
            "price":price,
            "description":description,
            "inventory":inventory,
            "picture":picture,
            "category":category
        },
        type: "post",
        success:function (result) {
            if(result=='true'){
                alert("添加成功！");
            }else{
                alert("添加失败！");
            }
        }
    });
}


function notebooksubmit() {
    var name = $("#name").val();
    var color = $("#color").val();
    var price = $("#price").val();
    var description = $("#description").val();
    var inventory = $("#inventory").val();
    var picture = $("#picture").val();
    var category = $("#category").val();
    alert(name);

    var notebookscreensize = $("#notebookscreensize").val();
    var cpu = $("#cpu").val();
    var notebookseries = $("#notebookseries").val();
    var notebookthickness = $("#notebookthickness").val();
    var harddisk = $("#harddisk").val();
    var notebookmemory = $("#notebookmemory").val();
    var notebookscreenresolution = $("#notebookscreenresolution").val();
    var standbytime = $("#standbytime").val();
    var weight = $("#weight").val();
    var extensiondisk=$("#extensiondisk").val();
    $.ajax({
        url:"../goods.do",
        data:{
            "method":"addNotebook",
            "notebookscreensize":notebookscreensize,
            "cpu":cpu,
            "notebookseries":notebookseries,
            "notebookthickness":notebookthickness,
            "harddisk":harddisk,
            "notebookmemory":notebookmemory,
            "notebookscreenresolution":notebookscreenresolution,
            "standbytime":standbytime,
            "weight":weight,
            "extensiondisk":extensiondisk,

            "name":name,"color":color,
            "price":price,
            "description":description,
            "inventory":inventory,
            "picture":picture,
            "category":category
        },
        type: "post",
        success:function (result) {
            if(result=='true'){
                alert("添加成功！");
            }else{
                alert("添加失败！");
            }
        }
    });
}





